package com.zhentao.controller;

import com.zhentao.interfaceclass.LogInterface;
import com.zhentao.model.admin.log.param.LogParam;
import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName: AdminLogController
 * @Author: 振涛教育_Q
 * @Date: 2025/1/2 15:32
 */
@RestController
@RequestMapping("/user/info")
public class AdminLogController {
    @Autowired
    private SysLogService logService;

    /**
     * @description  日志查询
     * @author 振涛教育_小Q
     * @date    2025/1/2 15:33
      * @param
     * @return com.zhentao.model.common.dtos.ResponseResult
     */
    @PostMapping("/log")
    @LogInterface("管理端--日志记录")
    public ResponseResult logList(@RequestBody LogParam logParam){
        return logService.logList(logParam);
    }

    /**
     * @description  清空日志
     * @author 振涛教育_小Q
     * @date    2025/1/2 18:59
      * @param
     * @return com.zhentao.model.common.dtos.ResponseResult
     */
    @GetMapping("/clear/log")
    @LogInterface("日志管理--清空日志")
    public ResponseResult clearLog(){
        return logService.clearLog();
    }
}
